package com.sevennotes.classtable.model

import androidx.room.ColumnInfo
import androidx.room.Embedded
import androidx.room.Entity
import androidx.room.PrimaryKey
import java.io.Serializable
import java.util.*

@Entity(tableName = "class_record")
data class ClassRecord(
    @PrimaryKey(autoGenerate = true) var id: Int? = null,
    @ColumnInfo(name = "student_id") var studentId: Int = 0,
    @ColumnInfo(name = "gp_change") var gpChange: Int = 0,
    @ColumnInfo(name = "start_time") var startTime: Date = Date(),
    @ColumnInfo(name = "duration") var duration: Int = 0,
    @ColumnInfo(name = "note") var note: String = ""
) : Serializable {
    companion object {
        private const val serialVersionUID = 1L
    }
}

@Entity
data class ClassRecordWithName(
    @Embedded var classRecord: ClassRecord? = null,
    @ColumnInfo(name = "student_name") var studentName: String? = null,
)